

const {globalData} = getApp();
const {eventBus} = getApp().globalData;

Component({
  /**
   * 组件的属性列表
   */
  properties: {
    showList: {
      type: Array,
      value: [],
    },
  },

  /**
   * 组件的初始数据
   */
  data: {},

  /**
   * 组件的方法列表
   */

  methods: {
    // 跳转详情页面
    // gotoDetail(e) {
    //   const {item} = e.currentTarget.dataset;
    //   console.log(item);
    //   eventBus.emit('shortcutItem', item);
    //   wx.navigateTo({
    //     url: '/pageA/pages/detail/index'
    //   });
    // },
    gotoDetail(e) {
      const {item} = e.currentTarget.dataset;
      console.log(item)
      eventBus.emit("shortcutItem", item);
      if (item.type === 'content') {
        wx.navigateTo({
          url: "/pageA/pages/contentList/index",
        });
      } else if (item.type === 'sign') {
        if(globalData.userInfo.authStatus == 9){
          wx.navigateTo({
            url: "/pageA/pages/sign/index",
          });
        }else{
          this.triggerEvent("handleAuth");
        }
      } else if (item.type === 'activity') {
        wx.navigateTo({
          url: "/pageA/pages/activity/index",
        });
      } else if (item.type === 'feedback') {
        wx.navigateTo({
          url: "/pageA/pages/feedback/index",
        });
      }

    },
  },
});
